<template>
	<view class="template-details tn-safe-area-inset-bottom" style="background-color: #f3f3f3;">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar :isBack="true" backgroundColor="#4169E1" class="tatils">废料通网</tn-nav-bar>
	
		<view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
			<!-- 图文信息 -->
			<block>
				<view class="blogger__item" style="background-color: #fff;box-shadow: 5px 5px 5px 5px rgba(235, 235, 235, 0.5);width: 97%;margin: 0 auto;border-radius: 10px;padding: 10px;">
					<view  class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center">
						<view class="justify__author__info" >
							<view class="tn-flex tn-flex-row-center">
								<view class="tn-flex tn-flex-row-center tn-flex-col-center">
									<view>
										<tn-avatar  class="" shape="square" :src="winfo.dimage" size="xl">
										</tn-avatar>
									</view>
									<view class="tn-padding-right tn-text-ellipsis">
										<view style="font-size: 18px;" class="tn-padding-right tn-padding-left-sm tn-text-bold tn-text-lg">
											{{ winfo.name }}</view>
										<view class="tn-padding-top tn-padding-left-sm">
												开店时间:<span>{{ winfo.kdtimes }}</span></view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<block>
						<view style="margin-top: 10px;"  class="tn-padding-top-xs">
							<tn-scroll-list :indicator="false">
							  <view class="tn-flex">
							    <block v-for="(item, index) in winfo.imglist" :key="index">
							      <view class="tn-flex-1 tn-radius">
							        <view class="tn-flex tn-flex-direction-column">
			
									  <image style="border-radius: 5px;width: 90px;height: 90px;margin-left: 5px;" :src="item"
									  	mode="aspectFill"></image>
							        </view>
							      </view>
							    </block>
							  </view>
							</tn-scroll-list>
							
							
						<!-- 	<tn-grid hoverClass="none" :col="3">
								<block v-for="(image_item,image_index) in winfo.imglist" :key="image_index">
									<tn-grid-item style="width: 30%;border-radius: 5px;margin: 5px;background-color: #fff;box-shadow: inset 0 0 10px 5px #aaa;">
										<image style="border-radius: 5px;" class="blogger__main-image blogger__main-image--3" :src="image_item"
											mode="aspectFill"></image>
									</tn-grid-item>
								</block>
							</tn-grid> -->
						</view>
					</block>
					
					
				
				</view>
				<!-- 边距间隔 -->
			</block>
			<!-- <view style="display: block;margin-top: 5px;margin-bottom: 5px;font-size: 16px;
			height: 36px;line-height: 36px;padding-left: 5px;
			box-shadow: 5px 5px 5px 5px rgba(235, 235, 235, 0.5);width: 98%;border-radius: 10px;">
				开店时间:<span>{{ winfo.kdtimes }}</span>
			</view>
			<view style="overflow: hidden;padding: 5px;">
					<span class="ts">分类分类</span>
			</view> -->
		
		</view>
		<view style="padding-bottom: 20px;width: 98%;margin: 0 auto;margin-top: 5px;background-color: #fff;border-radius: 5px;box-shadow: 5px 5px 5px 5px rgba(235, 235, 235, 0.5);">
			<view style="padding: 5px;border: 1px solid #e7e7e7;">
				<view style="padding-left: 10px;font-size: 16px;">联系方式</view>
				<view style="overflow: hidden;margin-top: 15px;padding-left: 10px;padding-right: 10px;">
					<view style="width: 50%;float: left;text-align: left;">
						{{winfo.username}}:{{winfo.phone}}
					</view>
					<view style="width: 50%;float: left;text-align: right;">
						<text style="color: #3646FF;">联系TA</text>
					</view>
				</view>
			</view>
			<view style="padding: 5px;border: 1px solid #e7e7e7;">
				<view style="padding-left: 10px;font-size: 16px;">公司地址</view>
				<view style="overflow: hidden;margin-top: 15px;padding-left: 10px;padding-right: 10px;">
					<view style="width: 50%;float: left;text-align: left;">
						{{winfo.address}}
					</view>
					<view style="width: 50%;float: left;text-align: right;">
						<text style="color: #3646FF;">导航</text>
					</view>
				</view>
			</view>
			<view style="padding: 5px;border: 1px solid #e7e7e7;">
				<view style="padding-left: 10px;font-size: 16px;">公司介绍</view>
				<view style="overflow: hidden;margin-top: 15px;padding-left: 10px;padding-right: 10px;">
					<view style="width: 100%;float: left;text-align: left;">
						{{winfo.desc}}
					</view>
					
				</view>
			</view>
			<view style="padding: 5px;border: 1px solid #e7e7e7;">
				<view style="padding-left: 10px;font-size: 16px;">最新报价</view>
				<view style="overflow: hidden;margin-top: 15px;padding-left: 10px;padding-right: 10px;">
					<view style="width: 100%;float: left;text-align: left;">
						{{winfo.money}}
					</view>
				</view>
			</view>
		</view>
		<view class="footerfixed dd-glass">
			<tn-button @click="playphone(winfo.phone)" 
			style="margin: 0 auto;margin: 0 auto;display: block;width: 100%;line-height: 40px;" backgroundColor="#4169E1" fontColor="#ffffff" size="lg" width="100%">拨打号码</tn-button>
		</view>
	</view>
</template>

<script>
	import {getDetail} from '@/apis/shop.js'
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	export default {
		name: 'TemplateDetails',
		mixins: [template_page_mixin],
		data() {
			return {
				content: [
					{
						userAvatar: 'https://resource.tuniaokj.com/images/blogger/blogger_beibei.jpg',
						userName: '可我会像',
						date: '2022年5月20日',
						label: ['开源', '创意'],
						desc: '开源可商用组件',
						mainImage: [
							'https://resource.tuniaokj.com/images/blogger/y11.jpg',
							'https://resource.tuniaokj.com/images/blogger/y33.jpg',
							'https://resource.tuniaokj.com/images/blogger/y22.jpg',
							'https://resource.tuniaokj.com/images/blogger/y44.jpg',
							'https://resource.tuniaokj.com/images/blogger/y55.jpg',
						],
						viewUser: {
							latestUserAvatar: [{
									src: 'https://resource.tuniaokj.com/images/blogger/avatar_4.jpeg'
								},
								{
									src: 'https://resource.tuniaokj.com/images/blogger/avatar_3.jpeg'
								},
								{
									src: 'https://resource.tuniaokj.com/images/blogger/avatar_2.jpeg'
								},
								{
									src: 'https://resource.tuniaokj.com/images/blogger/avatar_1.jpeg'
								},
							],
							viewUserCount: 65
						},
						collectionCount: 265,
						commentCount: 22,
						likeCount: 102
					}
				],
				winfo:''
			}
		},
		onLoad(opent) {
			this.getdp(opent.id);
		},
		methods: {
			getdp(e){
				let data = {
					id:e
				}
				getDetail(data).then(res => {
					this.winfo = res.data	
				}).catch(error => {
					that.tool.toastTip('登录出错,请稍后重试!', 'none', 1000)
				})
			},
			playphone(e){
				 	uni.makePhoneCall({
				    phoneNumber: e, 
					success: (res) => {
						console.log('调用成功!')	
					},
					fail: (res) => {
						console.log('调用失败!')
					}
				  });
			},
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.tatils{
		color: #fff;
	}
	/* 胶囊*/
	.tn-custom-nav-bar__back {
		width: 100%;
		height: 100%;
		position: relative;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		box-sizing: border-box;
		background-color: rgba(0, 0, 0, 0.15);
		border-radius: 1000rpx;
		border: 1rpx solid rgba(255, 255, 255, 0.5);
		color: #FFFFFF;
		font-size: 18px;

		.icon {
			display: block;
			flex: 1;
			margin: auto;
			text-align: center;
		}

		&:before {
			content: " ";
			width: 1rpx;
			height: 110%;
			position: absolute;
			top: 22.5%;
			left: 0;
			right: 0;
			margin: auto;
			transform: scale(0.5);
			transform-origin: 0 0;
			pointer-events: none;
			box-sizing: border-box;
			opacity: 0.7;
			background-color: #FFFFFF;
		}
	}

	/* 文章内容 start*/
	.blogger {
		&__item {
			padding: 30rpx;
		}

		&__author {
			&__btn {
				margin-right: -12rpx;
				padding: 0 20rpx;
			}
		}

		&__desc {
			line-height: 55rpx;

			&__label {
				padding: 0 20rpx;
				margin: 0rpx 18rpx 0 0;

				&--prefix {
					color: #00FFC8;
					padding-right: 10rpx;
				}
			}

			&__content {}
		}

		&__content {
			margin-top: 18rpx;
			padding-right: 18rpx;

			&__data {
				line-height: 46rpx;
				text-align: justify;
				overflow: hidden;
				transition: all 0.25s ease-in-out;

			}

			&__status {
				margin-top: 10rpx;
				font-size: 26rpx;
				color: #82B2FF;
			}
		}

		&__main-image {
			border-radius: 16rpx;

			&--1 {
				max-width: 80%;
				max-height: 300rpx;
			}

			&--2 {
				max-width: 260rpx;
				max-height: 260rpx;
			}

			&--3 {
				height: 212rpx;
				width: 100%;
			}
		}

		&__count-icon {
			font-size: 40rpx;
			padding-right: 5rpx;
		}

		&__ad {
			width: 100%;
			height: 500rpx;
			transform: translate3d(0px, 0px, 0px) !important;

			::v-deep .uni-swiper-slide-frame {
				transform: translate3d(0px, 0px, 0px) !important;
			}

			.uni-swiper-slide-frame {
				transform: translate3d(0px, 0px, 0px) !important;
			}

			&__item {
				position: absolute;
				width: 100%;
				height: 100%;
				transform-origin: left center;
				transform: translate3d(100%, 0px, 0px) scale(1) !important;
				transition: transform 0.25s ease-in-out;
				z-index: 1;

				&--0 {
					transform: translate3d(0%, 0px, 0px) scale(1) !important;
					z-index: 4;
				}

				&--1 {
					transform: translate3d(13%, 0px, 0px) scale(0.9) !important;
					z-index: 3;
				}

				&--2 {
					transform: translate3d(26%, 0px, 0px) scale(0.8) !important;
					z-index: 2;
				}
			}

			&__content {
				border-radius: 40rpx;
				width: 640rpx;
				height: 500rpx;
				overflow: hidden;
			}

			&__image {
				width: 100%;
				height: 100%;
			}
		}
	}
	.ts{
		color: #3646FF;
		width: 80px;
		float: left;
		border-radius: 5px;
		text-align: center;
		padding: 5px 3px 5px 3px;
		margin-left: 5px;
		font-size: 12px;
		border: 1px solid #3646FF;
		display: block;
	}
	/* 文章内容 end*/

	/* 间隔线 start*/
	.tn-strip-bottom {
		width: 100%;
		border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
	}

	/* 间隔线 end*/

	/* 头像 start */
	.logo-image {
		width: 60rpx;
		height: 60rpx;
		position: relative;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}


	/* 底部 start*/
	.footerfixed {
		position: fixed;
		width: 100%;
		bottom: 0;
		z-index: 999;
		background-color: rgba(255, 255, 255, 0.5);
		box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	.tabbar {
		align-items: center;
		min-height: 130rpx;
		padding: 0;
		height: calc(130rpx + env(safe-area-inset-bottom) / 2);
		padding-bottom: calc(30rpx + env(safe-area-inset-bottom) / 2);
		padding-left: 10rpx;
		padding-right: 10rpx;
	}

	/* 毛玻璃*/
	.dd-glass {
		width: 100%;
		backdrop-filter: blur(20rpx);
		-webkit-backdrop-filter: blur(20rpx);
	}

	/* 头像*/
	.avatar-all {
		width: 60rpx;
		height: 60rpx;
		border: 4rpx solid rgba(255, 255, 255, 0.05);
		border-radius: 50%;
		overflow: hidden;
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
	}

	/* 内容*/
	.topic {
		position: relative;
		height: 100%;
		z-index: 1;
		margin-bottom: 120rpx;


		/* 表单信息 start */
		&__info {
			margin: 0 50rpx;
			margin-top: 105rpx;
			padding: 30rpx 51rpx;
			border-radius: 20rpx;
			background-color: rgba(255, 255, 255, 1);
			border: 2rpx solid rgba(255, 255, 255, 0.1);
			box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);

			&__item {

				&__input {
					width: 400rpx;
					height: 60rpx;
					border: 1rpx solid #C6D1D8;
					border-radius: 39rpx;

					&__left-icon {
						width: 10%;
						font-size: 44rpx;
						margin-left: 20rpx;
						margin-right: 5rpx;
						color: #C6D1D8;
					}

					&__content {
						width: 80%;
						padding-left: 10rpx;

						&--verify-code {
							width: 56%;
						}

						input {
							font-size: 30rpx;
							color: #78909C;
							// letter-spacing: 0.1em;
						}
					}

					&__right-icon {
						width: 10%;
						font-size: 34rpx;
						margin-right: 20rpx;
						color: #78909C;
					}

					&__right-verify-code {
						width: 34%;
						margin-right: 20rpx;
					}
				}

				&__button {
					width: 100%;
					height: 60rpx;
					text-align: center;
					font-size: 31rpx;
					font-weight: bold;
					line-height: 77rpx;
					// text-indent: 1em;
					border-radius: 100rpx;
					color: #FFFFFF;
					background-color: rgba(255, 255, 255, 0.2);
					// border: 2rpx solid #FFFFFF;
				}

				&__sure {
					height: 60rpx;
					width: 140rpx;
				}

			}
		}

		/* 表单信息 end */

		/* 内容 end */

	}

	/deep/.input-placeholder {
		font-size: 30rpx;
		color: #C6D1D8;
	}
</style>